package com.worldcup.dao.question;

import com.worldcup.model.question.QuestionMatchResult;
import com.worldcup.service.question.QuestionMatchResultService;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface QuestionMatchResultMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(QuestionMatchResult record);

    int insertSelective(QuestionMatchResult record);

    QuestionMatchResult selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(QuestionMatchResult record);

    int updateByPrimaryKey(QuestionMatchResult record);

    /**
     * 获取匹配结果
     * @param openid
     * @param passiveOpenid
     * @return
     */
    QuestionMatchResult getMatchResult(@Param("openid") String openid, @Param("passiveOpenid") String passiveOpenid);

    List<QuestionMatchResult> getFriendRank(@Param("openid")String openid, @Param("passiveOpenids")List<String> friendOpenids);

    /**
     * 获取非好友匹配结果
     * @param openid
     * @param friendOpenids
     * @return
     */
    List<QuestionMatchResult> getMatchResultExclude(@Param("openid")String openid, @Param("passiveOpenids")List<String> friendOpenids);
}